package home_work3;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Scanner;

public class test7 {

	public static void main(String[] args) throws ParseException {
		int num=new Scanner(System.in).nextInt();
		Emp [] per=new Emp[num];
		ArrayList<Emp> list = new ArrayList<>();
		for(int i=0;i<num;i++) {
		String name=new Scanner(System.in).next();
		int age=new Scanner(System.in).nextInt();
		String gender=new Scanner(System.in).next();
		int salary=new Scanner(System.in).nextInt();
		String hiredate=new Scanner(System.in).next();
		SimpleDateFormat dat = new SimpleDateFormat("yyyy-MM-dd");
		Date dat1 = dat.parse(hiredate);
		per[i]=new Emp(name,age,gender,salary,dat1);
		if(list.contains(per[i])==false) {
			list.add(per[i]);
		}else {continue;}
		
		}
		
		for(int i= 0; i < list.size(); i++){
		    System.out.println(list.get(i));
		}
	}

}
